{include file=header.html}
        <script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=ajaxfileupload.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
        <script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
        <link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
        <style>
            label.error {color:red;}
			table,th,td{border:1px solid #000;}
        </style>
<script type="text/javascript">
$(function(){
	$("#re_count").change(function(){
		var re_count=parseInt($(this).val());
		var one_money={$order.factory_price};
		$("#re_money").val(re_count*one_money);
		});
})

function confirm_re(rid)
{
	if(confirm('确认此退货信息吗？')==true)
	{
	$("#rid").val(rid);
	$("#regoods_form").submit();
	}
}
</script>
<body>
  <div class="sub-body" style="width: 650px">
   	<div class="tab_info">
		<div class="tab-title-1"><span>商店退货</span></div>
      	<form action="" method="post" name="regoods_form" id="regoods_form">
          <input type="hidden" name="rid" id="rid"  />
        <table width="650" border="1" cellspacing="0" cellpadding="0" >
	      <tr>
		      <th>退货日期</th><th>退货件数</th><th>金额</th><th>是否要求退回</th><th width="60">状态</th>
		      <th>操作</th>
	      </tr>
   		{if $smarty.get.act eq 'regoods_edit'}
          <tr style="text-align: center">
		    <td><input type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="{$now|date:Y-m-d}" name="re_date" style="width: 80px" /></td>
		    <td><input size="5" type="text" name="re_count" id="re_count" /></td>
		    <td><input size="5" type="text" readonly="readonly" name="re_money" id="re_money" /></td>
		    <td><input size="6" value="1" type="checkbox" name="re_is_back" /></td>
		    <td>&nbsp;</td>
		    <td><input type="submit" name="submit" value="新建" class="btn-1" /></td>
		  </tr>
  		{/if}
		 {foreach from=$re_list item=re}
		  <tr style="text-align: center">
		    <td>{$re.re_date|date}</td>
		    <td>{$re.re_count}</td>
		    <td>{$re.re_money}</td>
		    <td><input size="6" {if $re.re_status neq ORDER_DIS_STATUS_SEND_FACTORY OR $smarty.get.act neq 'return_goods_view'}disabled="disabled"{/if}  {if $re.re_is_back}checked="checked"{/if} value="1" type="checkbox" name="re_is_back" /></td>
		    <td>{$lang.salesreturn_status.$re.re_status}</td>
		      {if $user.role eq USER_FACTORY AND $user.factory_id eq $order.factory_id}
		    <td>
		    {if $re.re_status eq ORDER_DIS_STATUS_SEND_FACTORY AND $smarty.get.act eq 'return_goods_view'}<input type="button"  onclick="confirm_re({$re.rid})" value="确认" class="btn-1" />
		    {/if}</td>
		    {elseif $user.role eq USER_CIVILIAN && $re.re_status eq ORDER_DIS_STATUS_SEND_FACTORY}
		    <td><input type="button" value="删除" class="btn-1" onclick="javascript:if(confirm('确认删除此商店退货吗?')==true){location.href='{url app=order&act=drop_re_goods&rid=$re.rid}';};" /></td>
		    {else}
		    <td>&nbsp;</td>
		    {/if}
		  </tr>
		{/foreach}
		  <tr>
		    <th>总退货件数</th>
		    <td colspan="2">{$salesre_sum_info.re_count_sum}</td>
		    <th>总退货金额</th>
		    <td colspan="2">{$salesre_sum_info.re_money_sum}</td>
		  </tr>
		</table>
        </form>
        <div style="padding-top: 8px;text-align: center;">
        	<input type="button" class="btn-2" value="返回" onclick="history.back();" />
        </div>
      </div>
    </div>
<div id="remsg"></div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
</body>
    {$async_sendmail}
</html>